package com.yanyeori.framework.log.common.constant;

/**
 * LogIgnore忽略类型
 *
 * @author chenkuan 2022/11/18
 */
public enum LogIgnoreType {
    REQUEST,
    PARAM,
    RESPONSE,
    ALL;

    LogIgnoreType() {
    }

    public static boolean ignore(LogIgnoreType[] sourceTypes, LogIgnoreType... targetTypes) {
        if (sourceTypes == null || sourceTypes.length == 0) {
            return false;
        }
        for (LogIgnoreType sourceType : sourceTypes) {
            for (LogIgnoreType targetType : targetTypes) {
                if (sourceType == targetType) {
                    return true;
                }
            }
        }
        return false;
    }
}
